<%@ page language="java"
	import="java.util.*,bc.swim2.ejb.entity.RegisteredUser,bc.swim2.ejb.entity.RegisteredUser"
	contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%
	RegisteredUser currentUser = (RegisteredUser) (session
			.getAttribute("currentSessionUser"));
	if (currentUser == null) {
%>
<body>Where are you going?
</body>
<%
	} else {
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Your Friends</title>
<style>
@import url(css/main.css);
</style>
</head>
<body>
	<div id="allContainer">
		<div id="titleContainer">
			<%%>
			<img src="img/swimScritta.gif" id="imageFloat" width=100px;
				height="100px">
			<h1 id="userHomeTitle">
				Welcome,
				<%=currentUser.getFirstName() + " "
						+ currentUser.getLastName()%>!
			</h1>
		</div>
		<div id="container">
			<div id="navigationContainer">
				<a href="MainServlet?to=RegisteredUserHome" id="linkRef">Home</a> <br />
				<a href="MainServlet?to=SearchHelp" id="linkRef">Search Help</a> <br />
				<a href="MainServlet?to=SearchUsers" id="linkRef">Search Users</a> <br />
				<a href="MainServlet?to=MyAbilities" id="linkRef">Declare/Remove
					ability</a> <br /> <a href="MainServlet?to=FriendshipRequests"
					id="linkRef">Friendship Requests</a> <br /> <a
					href="MainServlet?to=Friends" id="linkRef">Your Friends</a> <br />
				<a href="MainServlet?to=MyFeedback" id="linkRef">Feedback</a> <br />
				<a href="MainServlet?to=AbilityRequest" id="linkRef">Ability
					Request</a> <br /> <a href="LoginServlet?methodName=logout"
					id="linkRef">Logout</a>
			</div>
			<div id="actionContainer">
				<h1 id="listTitle">Your Friends:</h1>
				<br>
				<%
					List<RegisteredUser> friends = null;
						friends = (List<RegisteredUser>) request
								.getAttribute("friendList");
				%><table>
					<%
						for (RegisteredUser f : friends) {
								String username = f.getUsername();
								String firstname = f.getFirstName();
								String lastname = f.getLastName();
								int ruId = f.getId();
					%>
					<tr>
						<td><a
							href="MainServlet?to=Profile&userId=<%out.print(ruId);%>"
							id="linkRefB"><%=username%></a></td>
						<td><%=firstname%></td>
						<td><%=lastname%></td>
					</tr>
					<%
						}
					%>
				</table>
				<br>
			</div>
		</div>
	</div>

</body>
<%
	}
%>
</html>